package com.hongliang.advantage;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Date;

/**
 * @author Hongliang Zhu
 * @create 2022-12-04 13:05
 */
public class OioClient {

    public static void main(String[] args) {
        try {
            Socket s = new Socket();
            System.out.println(new Date()+" connecting...");
            s.connect(new InetSocketAddress("localhost", 9999),1000);
            System.out.println(new Date()+" connected...");
            s.getOutputStream().write(1);
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
